package Controller;

import com.alibaba.fastjson.JSONArray;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import util.ExcelUtils;

@RestController
@RequestMapping("/api/ceshi")
public class importExcel {

    @GetMapping("num")
    public int hashCode() {
        return 1;
    }

    @RequestMapping("/import")
    public JSONArray importUser(@RequestPart("file") MultipartFile file) throws Exception {
        JSONArray array = ExcelUtils.readMultipartFile(file);
        System.out.println("导入数据为:" + array);
        return array;
    }
}
